package com.by.cloud.enums;

import lombok.Getter;

/**
 * 审核状态枚举类
 *
 * @author: linweirui
 * @date: 2024/12/11 10:49
 */
@Getter
public enum ReviewStatusEnum {
    /**
     * 枚举值
     */
    REVIEWING("待审核", 0),
    PASS("通过", 1),
    REJECT("拒绝", 2);

    private final String text;

    private final int value;

    ReviewStatusEnum(String text, int value) {
        this.text = text;
        this.value = value;
    }

    /**
     * 根据值获得枚举项
     *
     * @param value 值
     * @return 枚举
     */
    public static ReviewStatusEnum getEnumByValue(int value) {
        for (ReviewStatusEnum statusEnum : values()) {
            if (statusEnum.value == value) {
                return statusEnum;
            }
        }
        return null;
    }
}
